package org.basic;

import io.netty.channel.DefaultEventLoopGroup;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.util.concurrent.EventExecutor;

/**
 * @author wind
 * @create 2025-01-15 15:42
 */
public class EventLoopGroupDemo {
    public static void main(String[] args) {
        DefaultEventLoopGroup eventGroup = new DefaultEventLoopGroup(2);
        System.out.println(eventGroup.next());
        System.out.println(eventGroup.next());
        System.out.println(eventGroup.next());
        for(EventExecutor group : eventGroup){
            System.out.println(group);
        }
        eventGroup.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello");
            }
        }, 2, 2, java.util.concurrent.TimeUnit.SECONDS);
    }
}
